package com.guoguo.websocketdemo.websocketdemo.controller;


import com.guoguo.websocketdemo.websocketdemo.service.WebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import java.util.concurrent.CopyOnWriteArrayList;

@RestController
@RequestMapping("user/")
public class GuoController {
    @Autowired
    private WebSocket webSocket;

    @RequestMapping("add")
    public String page1(){
        webSocket.sendMessage("张三");
        return null;
    }

}
